package com.example.hangzhou.welbeing.mytestdemoapp.designPatterns.singleModel;

/**
 * 杭州惟君医疗科技有限公司10
 * Created by 20433 on 2018/5/21
 *
 * @desc 东风山河绿，春已不折柳，繁花看不尽，处处惹人留
 * @desc 佛祖镇楼，bug辟容易 --------------------------->静态内部类
 *
 * @desc 利用classloader保证了同步，同时又能让开发者控制类加载的时机
 */

public class StaticInnerSingle_06 {
    private StaticInnerSingle_06() {
    }
    private static class SingletonHolder{
        private static final StaticInnerSingle_06 instance = new StaticInnerSingle_06();
    }
    private static StaticInnerSingle_06 getInstance(){
        return SingletonHolder.instance;
    }
}
